#include"Mutexion.h"
Mutexion::Mutexion(){
    int ret = pthread_mutex_init(&_mutex,nullptr);
    if(ret){
        perror("pthread mutex fail");
        return;
    }
}
Mutexion::~Mutexion(){
    pthread_mutex_destroy(&_mutex);
    cout<<"~Mutexion"<<endl;}
pthread_mutex_t* Mutexion::getMutex(){
    return &_mutex;
}

void Mutexion::lock(){
    pthread_mutex_lock(&_mutex);
}
void Mutexion::trylock(){
    pthread_mutex_trylock(&_mutex);
}
void Mutexion::unlock(){
    pthread_mutex_unlock(&_mutex);
}